CC=gcc -Wall
CFLAGS=-fPIC `pkg-config --cflags libnotify` -I/usr/lib/jvm/default-java/include
LIBS=`pkg-config --libs libnotify`
BUILD_DIR=build/classes
SRC_DIR=jni

libjnotify: ${SRC_DIR}/jnotify.o
	${CC} -shared -Wl,-soname,libjnotify.so.1 -o ${BUILD_DIR}/libjnotify.so ${SRC_DIR}/jnotify.o ${LIBS}
	
jnotify.o: ${SRC_DIR}/jnotify.c
	cd ${SRC_DIR} && ${CC} -Wall ${CFLAGS} -c jnotify.c && cd ..

jnotifyosd.jar:
	ant

libjnotify.deb:
	cp -r deb deb-tmp
	sudo chown -R root:root deb-tmp
	sudo chmod -R 0755 deb-tmp
	find . -type f -execdir sudo chmod 0644 \{\} \;
	dpkg -b deb-tmp dist/libjnotify.deb
	sudo rm -r deb-tmp
	
